<?php

	$nav = array("Home" => "", "Gallery" => "gallery/", "Picture" => "gallery/picture/index.php?gid=$gid");

	$tpl->assign("dsfm_nav", $nav);

	$table = new Table( array(
		"image" => array(
			"width" => 150,
			"height" => 200,
			"type" => "image",
		),
	));

	$sql = "SELECT * FROM gallery_picture WHERE gid = $gid ORDER by sort ASC";

	$rss = $db->query($sql);

	$data = new Data($rss);

	$table->add_data($data->fetch());

	$table->add_menu( array(
		"Add New" => array(
			"link" => "picture/form.php?gid=$gid",
			"icon" => "add.png",
//			"multi" => true
		)
	));

	$table->add_tool( array(
		"edit" => array(
			"link" => 'picture/edit.php?id=$id&gid=$gid',
			"icon" => "edit.png"
		),

		"delete" => array(
			"link" => 'picture/delete.php?id=$id&gid=$gid',
			"icon" => "delete.png"
		)
	));

//	$table->sortable("cid", URL."admin/product/sort.php");

	$table->rain_display($tpl, "gallery");
?>